package com.alipay.config;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102400750201";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJFJXk1ijxT0Zb10vGIRL7/E0XdEcTknBxy20BRWN76frK5PeQz32PTHva6RZb1I5g3Xu0OVooTrfblNYj+ZA5fKq0pUCRZOXrQTLT+Kpy9IhCQeZIxKNEds7h/zlOlOMYqlojGhCVkR3AJemTwRjY7u3PktRZbq+++WcHkY8dTlzTvJ7Dr8ZstCgu42gjVFaDXNg/Ru3rXF9MlCVSHRUYAEKt/7nlsyszMeegHXxdkwLCCHez5VUkotWDr3TqystFTjhRff1v6e2Cvd7MLzgU/HDq1g8/ZrL/U4u13XZXDrzijedSE5heyYiz1CpjSMSPt9fpMXYQRZtb94egRg9/AgMBAAECggEAUm6QnOW0BTh4xO244VIuSl20NjB0NW7QM33y9Nq3MmLHr4702J4NkUibCk80ZNBzNgi6ROxgLPD5WxArncKLWiZ/uNXO+B/Gqyuv1wwn46zs63sZchTdYWRYkEqcOYcK8WAviAA6jNaRH2UtCu8JdBpp43MWQxlukdcEf+amOyZljwgYkmhB0JJffY84Y2JlKJey1YA1PjUMpZK8RGMdnZdMNp9suhf5YKEwWxKgJ0R0pCRlE35UZAsvEGs3Y4TlXkHLeaxYx1H+IsMzjTLNn7nTBtxhYBZDo0YaiayGkIELssfaXJEd5RbKeGZcHl7THfc2SJ9gNVUSwQxJ6psTkQKBgQDyfbP7DrTx/e50LBpJQp0ASl2gXG3+xOIFLqJqFoAJ5ct0qWAqmInSXrl7hrjPYrVRBrlCppuLCVPikEqOGlpb87KqXFeYaxAAaQrZ96CASNjhk4KyLnK47No43BQzYBHqQ0iG23T+Ofs2tyiDAehPIQiaQLF+pFLws1Yy+aOg5QKBgQCQt5Bq5CxJmUrrPR0Iq9J5CKZIBuRz8rEAkxtU4/nXyJ4NGx04ENY64V4OTEZsWOiOTLR4E5Eqjdhn/rHuIv/HV7FyeIXADa450vOB2+825ByutiEfljk2BL5SyYbYymB67gd227Kh2LJQLGV4PfSbBmYLXmKFpj76mGxA7H88kwKBgEmJ66IwpJla3AzpLxOWmwxygRBX15fS14SgzuqDZlMaGGiJ0Ts5xVpCFdgrVDK4iapH8rkO088HhiQIhEOyJEMMldtqY7o6hcDKGltd6JPfA77tQE6PHYWNduSVgZ7O/L/hpcYYGdPbe57tTuDkHDKbHwPAqNNyPCD5EiQlZwUtAoGAe0ThLyvMzaRVvKsB4DD7xz0m5pN4ZYuEWgj0bwsB9lxcxK0j5m3xDZaKl4NBOWlCLnQIBYAlVyob+/lndoE5foOkEu22gDEnBvo5kZPV39vO0sMw08cSVIEV3U7sHh3EsPGwSf452sLKoKAwjou3n5WDtotfQJirbKoJDARnHSECgYEAuwEFR33ICASTnlOZMQP7mXPH1vhyyg9oKmclv7+Tvpc937r1aTgJ8mFxi+lFhO9r8rl6YXeBQeqqruupr+jmH8sUJw3duR3OnS7aUes9yGu9z2gm4HhbWnLtyBlZcwlMXxyV0+KdZp3VOXdL/5oNIduQrmx0zyRR2adoCDMupsw=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjXrKy6TsIGohlIrgpLAokl+iS9UygtYuR2GcSEUjiaTWj80wigJt1Bo/T95LfrfkV3B5LM4BsTNYRPSUGDa9NHljMBYs6FOLt7e+GsMQDZ4dTuQ27v4tknmIxE312rjrnIUs/M00q31kFgWb878uYp6JFqtBg2NIsS1ol1wr1rOzMTBx4O75E0X/ZVNLw1RYyEmrFPJNsXMS4d+2IkECAivbCYCJMmxlmLoPDXQRQF5MaFjUnTYaiDujMXNUjJpQZHqJBGrCCeCRqpgaoRm6bIGIE7BgtvvVRm2PUCWeXeuAdvuj6nuqwyN/jzBzE6sxKQzzIE+q+TmpCF+uU+8IeQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//	public static String notify_url = "http://healthpay.free.idcfengye.com/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
	public static String notify_url = "http://healthpay.vipgz4.idcfengye.com/pay/notify.do";


	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//	public static String return_url = "http://healthpay.free.idcfengye.com/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://healthpay.vipgz4.idcfengye.com/pages/success.html";


    // 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

